package arch.dao.impl.manager;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import arch.dao.manager.ClassificationDao;
import arch.domain.archive.Classification;

@Repository("classificationDao")
public class ClassificationDaoImpl implements ClassificationDao {
	@Resource private JdbcTemplate jdbcTemplate;
	
	@SuppressWarnings("unchecked")
	public List<Classification> list(String sql, Object... args) {
		List<Classification> result = null;
		if(sql != null && !"".equals(sql.trim())) {
			result = this.jdbcTemplate.query(sql, args, new ClassificationRowMapper());
		}
		return result;
	}
	public Classification find(String sql, Object... args) {
		Classification result = null;
		
		if(sql != null && !"".equals(sql.trim())) {
			result = (Classification)jdbcTemplate.queryForObject(sql, args, new ClassificationRowMapper());
		}
		
		return result;
	}
}
